<{include file="public/header.html"}>
<script type="text/javascript" src="<{$smarty.const.STATIC_COMPONENT_URL}>js/common.js"></script>
<{FRM_XOAD::getClientCode()}>

<script type="text/javascript">
	function validate()
	{
	    if (validateEmail())
		{
			document.signup.submit();
		}
		return false;
	}
	
	function validateEmail()
	{
		var form = document.signup;
		var email = document.signup.email;		
		var username = document.signup.username;
		var password = document.signup.password;
		var confirm_password = document.signup.confirm_password;
		var postcode = document.signup.postcode;
		var telephone = document.signup.telephone;
		var mobilephone = document.signup.mobilephone;
		
		email.value = trim(email.value);
		username.value = trim(username.value);
		
		if (username.value == '')
		{
			alert('<{#_LB_VALIDATE_USERNAME#|utf8_escape_js}>');
			username.focus();
			return false;
		}
		
		if(password.value == ''){
			alert('<{#_LB_VALIDATE_PASSWORD_EMPTY#|utf8_escape_js}>');
			password.focus();
			return false;
		}
		
		if (email.value == '')
		{
			alert('<{#_LB_VALIDATE_EMAIL#|utf8_escape_js}>');
	        email.focus();
			return false;
		}
		
		if(isNaN(postcode.value)){
			alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
	        postcode.focus();
			return false;
		}
		
		if(isNaN(telephone.value)){
			alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
			telephone.focus();
			return false;
		}
		
		if(isNaN(mobilephone.value)){
			alert('<{#_LB_VALIDATE_NUMBER#|utf8_escape_js}>');
			mobilephone.focus();
			return false;
		}
		
		if (!emailCheck(email.value))
		{
			alert('<{#_LB_FORMAT_EMAIL#|utf8_escape_js}>');
	        email.focus();
			return false;
		}
	    
		return true;
	}

</script>
<div class="container">
    	<form action="" method="post" name="login" onsubmit="return validate() ;" >
    		<input type="hidden" id="act" name="act" value="1" />
        	<div class="signup">
                <div class="signup-title"><span>Login</span></div>
                <div class="form-signup">
	                <ul class="error">
	                <{foreach from=$error key=key item=value}>
	                	<li><{#$value#}></li>
	                <{/foreach}>
	                </ul>
                	<div class="row">
                    <label>Username</label><input type="text" name="username" value="<{$customer->username}>" />
                    </div>
                    <div class="row">
                        <label>Password</label><input type="password" name="password" />
                    </div>
                    <div class="row">
                    	<a href="<{$smarty.const.APPLICATION_URL}>/user/forgotpass">Forgot password</a><br/>
                    </div>
                    <div class="row">
                        <input type="image" src="<{$smarty.const.STATIC_COMPONENT_URL}>images/btnLogin.jpg" />
                    </div>
                </div>
            </div>
        </form>
    </div><!--end container-->
    <div class="clear"></div>
<{include file="public/footer.html"}>